<template>
    <div id="trunk">
		<vHead appPath="/course2" appTitle="排课评课"></vHead>
        <main class="main">
            <div class="course-index maxW">
                <div class="course-menunav">
                    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" >
                        <el-menu-item v-for="(item,key) in moduleRoute" v-if="item.showNav" :index="item.path" :key="key">
                            <router-link :to="combineLink(item)">{{item.txtName}}</router-link>
                        </el-menu-item>
                    </el-menu>
                </div>
                <router-view/>
            </div>
        </main>
        <vFoot/>
    </div>
</template>
<script>
import vHead from "@/components/common/header";
import vFoot from '@/components/common/footer';

export default {
    data() {
        return {
            FLAG:'course',
            isTeacher: false,
            isReser: false,
            activeIndex:'',
            moduleRoute:[]
        };
    },
    created() {

    },
    mounted(){
        //console.info(this.$route.name)
        this.activeIndex = (this.$route.path.split('/')[2]);
        // this.activeIndex = (this.$route.path.split('/')[2]).split('-')[0];
        //console.info(this.activeIndex)
        this.bindNav();
    },
    methods: {
        bindNav(){
            var ffmoduleRoute = is_empty( sessionStorage.getItem('route_str') ) ? []: JSON.parse( sessionStorage.getItem('route_str') );
            this.moduleRoute = ffmoduleRoute.children
        },
        combineLink( obj ) {
           return  '/'+this.FLAG+(is_empty( obj.path ) ? '' : '/'+ obj.path );
        },
       
        
    },
    components: {
		vHead,
		vFoot
    }
};
</script>
<style lang="scss">
.main {
    min-height: calc(100vh - 204px);
    padding: 25px 0 40px;
}
.course-menunav a {
    display: block;
    line-height: 65px;
}
@import "/assets/css/course.css";
</style>